/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.swirrel.component;

import java.awt.Dialog;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.Window;
import org.swirrel.Swirrel;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JDialog;

/**
 *
 * @author Gronau
 */
public class SwDialog extends JDialog {

    private WindowListener processListener = new WindowAdapter() {

        @Override
        public void windowOpened(WindowEvent we) {
            process();
        }
    };

    {
        this.addWindowListener(processListener);
    }

    public SwDialog() {
        super();
    }

    public SwDialog(Frame owner) {
        super(owner);
    }

    public SwDialog(Frame owner, boolean modal) {
        super(owner, modal);
    }

    public SwDialog(Frame owner, String title) {
        super(owner, title);
    }

    public SwDialog(Frame owner, String title, boolean modal) {
        super(owner, title, modal);
    }

    public SwDialog(Frame owner, String title, boolean modal,
            GraphicsConfiguration gc) {
        super(owner, title, modal, gc);
    }

    public SwDialog(Dialog owner) {
        super(owner);
    }

    public SwDialog(Dialog owner, boolean modal) {
        super(owner, modal);
    }

    public SwDialog(Dialog owner, String title) {
        super(owner, title);
    }

    public SwDialog(Dialog owner, String title, boolean modal) {
        super(owner, title, modal);
    }

    public SwDialog(Dialog owner, String title, boolean modal,
            GraphicsConfiguration gc) {
        super(owner, title, modal, gc);
    }

    /*The following code works in Java 1.6+ only

    public SwDialog(Window owner) {
        super(owner);
    }

    public SwDialog(Window owner, ModalityType modalityType) {
        super(owner, modalityType);
    }

    public SwDialog(Window owner, String title) {
        super(owner, title);
    }

    public SwDialog(Window owner, String title, Dialog.ModalityType modalityType) {
        super(owner, title, modalityType);
    }

    public SwDialog(Window owner, String title, Dialog.ModalityType modalityType,
            GraphicsConfiguration gc) {
        super(owner, title, modalityType, gc);
    }*/

    public void process() {
        Swirrel.process(this);
    }
}
